package TestDemo.example.mapper;

import TestDemo.example.pojo.Clazz;
import TestDemo.example.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.ArrayList;

@Mapper
public interface ClazzMapper {

    ArrayList<Clazz> getClazzParamList(ClazzQueryParam clazzQueryParam);

    @Delete("delete from clazz where id=#{id}")
    void deleteById(Integer id);

    void add(Clazz clazz);

    @Select("select id, name, room, begin_date beginDate, end_date endDate, master_id masterId, subject, create_time createTime, update_time updateTime ,subject subject from clazz where id=#{id}")
    Clazz getById(Integer id);

    void update(Clazz clazz);

    @Select("select id, name, room, begin_date , end_date , master_id , subject, create_time , update_time  ,subject  from clazz")
    ArrayList<Clazz> Clazzlist();
}
